<#assign pageName="系统会话管理">
<@override name="page-content">
<form class="layui-form form-horizontal" role="form" method="post">
    <table class="layui-table">
        <thead>
            <tr>
                <th class="align-center" width="50px" nowrap="nowrap">序号</th>
                <th class="align-center" nowrap="nowrap">用户ID</th>
                <th class="align-center" nowrap="nowrap">用户名称</th>
                <th class="align-center" nowrap="nowrap">登录时间</th>
                <th class="align-center" nowrap="nowrap">最后操作时间</th>
                <th class="align-center layui-hide-xs" nowrap="nowrap">IP地址</th>
                <th class="align-center layui-hide-xs" nowrap="nowrap">主机名</th>
                <th class="align-center layui-hide-xs" nowrap="nowrap">Mac地址</th>
                <th class="align-center" width="100px">操作</th>
            </tr>
        </thead>
        <tbody>
            <#if userSessionList?has_content>
                <#list userSessionList as dataItem>  
                <tr>
                    <td class="align-center" width="50px" nowrap="nowrap">
                        ${(pageNo-1)*pageSize+dataItem_index+1}
                    </td>
                    <td class="align-center" nowrap="nowrap">
                        ${dataItem.principal.users.userId}
                    </td>
                    <td class="align-center" nowrap="nowrap">
                        ${dataItem.principal.users.uname}
                    </td>
                    <td class="align-center">
                        ${(dataItem.principal.loginTime)?datetime}
                    </td>
                    <td class="align-center">
                        ${(dataItem.lastRequest)?datetime}
                    </td>
                    <td class="align-center layui-hide-xs" nowrap="nowrap">
                        ${dataItem.principal.ipAddress}
                    </td>
                    <td class="align-center layui-hide-xs" nowrap="nowrap">
                       ${dataItem.principal.hostName}
                    </td>
                    <td class="align-center layui-hide-xs" nowrap="nowrap">
                       ${dataItem.principal.macAddress}
                    </td>
                    <td class="align-center">
                        <div class="layui-table-cell">
                            <button type="button" class="layui-btn layui-btn-danger layui-btn-xs"
                                onclick="confirmSubmit('确定强制退出‘${dataItem.sessionId}’？', {sessionId:'${dataItem.sessionId}'},'logout')">
                                <i class="layui-icon layui-icon-delete"></i>删除
                            </button>
                        </div>
                    </td>
                </tr>
                </#list>
            <#else>
                <tr>
                    <td colspan="9" style="color:red;text-align:center;font-weight:bold;">暂无相应会话信息</td>
                </tr>
            </#if>  
            </tbody>
        </table>
       <@ctrl.pageShow recordCount!0, pageNo!0 />
    </form>
</@override>
<@override name="page-scripts">
    <script>
        $(function(){
            layui.use(['form','layer', 'jquery'], function(){
                var form=layui.form;
                var layer=layui.layer;
                var $ = layui.jquery;
            })
        })
    </script>
</@override>
<@extends name="/layout/basepage.html"/>